package com.it.od.od2024;

import java.util.Arrays;
import java.util.List;
import java.util.Scanner;
import java.util.stream.Collectors;

/**
 * @author: liminghui
 * @date: 2024/1/9 23:28
 * @version: 1.0
 * @description: 山脉的个数/攀登者1
 */
public class Main2 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String intput = sc.nextLine();
        List<Integer> list = Arrays.stream(intput.split(",")).map(x -> Integer.parseInt(x.trim())).collect(Collectors.toList());
        int count = 0;
        for (int i = 0; i < list.size(); i++) {
            if (i == 0) {
                if (list.get(i) > list.get(i + 1)) {
                    count++;
                }
            } else if (i == list.size() - 1) {
                if (list.get(i) > list.get(i - 1)) {
                    count++;
                }
            } else {
                if (list.get(i) > list.get(i - 1) && list.get(i) > list.get(i + 1)) {
                    count++;
                }
            }
        }
        System.out.println(count);
    }
}
